#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>

char* my_strstr(const char* arr1, const char* arr2)
{
	assert(arr1 && arr2);
	if(*arr2 == '\0')
	{
		return (char *)arr1;
	}
	while (*arr1)
	{
		const char* cpyarr1 = arr1;
		const char* cpyarr2 = arr2;
		int flag = 1;
		while (*cpyarr2)
		{
			if (*cpyarr1 != *cpyarr2)
			{
				flag = 0;
				break;
			}
			cpyarr1++;
			cpyarr2++;
		}
		if (flag)
		{
			return (char*)arr1;
		}
		arr1++;
	}
	return NULL;
}

int main()
{
	char arr1[] = "abbbbcdef";
	char arr2[] = "bbc";
	char* ret = my_strstr(arr1, arr2);
	printf("%s", ret);
	return 0;
}